package com.dlc.shop.api.controller;

import com.dlc.shop.bean.enums.AuditStatus;
import com.dlc.shop.bean.vo.ShopCompanyVO;
import com.dlc.shop.common.response.ServerResponseEntity;
import com.dlc.shop.service.ShopCompanyService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author gaozijie
 * @since 2024-01-17
 */
@Tag(name = "店铺工商信息接口")
@RequestMapping("/shopCompany")
@RestController
@AllArgsConstructor
public class ShopCompanyController {

    private ShopCompanyService shopCompanyService;

    @Operation(summary = "获取店铺工商信息")
    @Parameter(name = "shopId", description = "店铺id")
    @GetMapping("/{shopId}")
    public ServerResponseEntity<ShopCompanyVO> getInfo(@PathVariable Long shopId) {
        ShopCompanyVO shopCompanyVO = shopCompanyService.getInfo(shopId, AuditStatus.SUCCESSAUDIT.value());
        return ServerResponseEntity.success(shopCompanyVO);
    }
}


